package cn.ibizlab.util.service;


import cn.ibizlab.util.security.AuthenticationInfo;
import cn.ibizlab.util.security.AuthenticationUser;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import java.util.*;


public interface AuthenticationUserService extends UserDetailsService {

    @Override
    default AuthenticationUser loadUserByUsername(String username){
        return null ;
    }

    AuthenticationInfo loadUserByLogin(String username, String password);

    default void resetByUsername(String username) {

    }

    Map<String,Object> getAppData();

    default Map<String,List<String>> getOrgInfo(String organizationId, String departmentId) {
        return new HashMap<>();
    }

    String generateToken(UserDetails userDetails);

    Boolean validateToken(String token, UserDetails userDetails);

    String getUsernameFromToken(String token);

    Date getExpirationDateFromToken(String token);

    /**
     * 获取jws签名公钥
     * @return
     */
    default String getSignatureKey(){
        return null;
    }
}
